/**
 * 
 */
package com.odontosis.view;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;

import com.odontosis.entidade.OdontosisBusinessObject;

/**
 * Formulrio do sistema Odontosis.
 * @author Oto
 *
 */
public abstract class OdontosisForm extends ActionForm {
	private Long id;
	private String metodo;
	private String editavel;
	private String edicao;
	private String excluido;
	
	public String getExcluido() {
		return excluido;
	}


	public void setExcluido(String excluido) {
		this.excluido = excluido;
	}

	
	public String getEdicao() {
		return edicao;
	}

	public void setEdicao(String edicao) {
		this.edicao = edicao;
	}

	public String getEditavel() {
		return editavel;
	}

	public void setEditavel(String editavel) {
		this.editavel = editavel;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the metodo
	 */
	public String getMetodo() {
		return metodo;
	}

	/**
	 * @param metodo the metodo to set
	 */
	public void setMetodo(String metodo) {
		this.metodo = metodo;
	}

	/**
	 * Transfere valores do formulrio para BOs.
	 * @param form Formulrio.
	 * @param businessObjects BOs.
	 * @throws IllegalAccessException
	 * @throws InvocationTargetException
	 */
	public void transferirParaBOs(OdontosisForm form, OdontosisBusinessObject... businessObjects) 
			throws IllegalAccessException, InvocationTargetException {
		for (OdontosisBusinessObject odontosisBusinessObject : businessObjects) {
			BeanUtils.copyProperties(odontosisBusinessObject, form);
		}
	}
	
	/**
	 * Transfere valores dos BOs para formulrio.
	 * @param form Formulrio.
	 * @param businessObjects BOs.
	 * @throws IllegalAccessException
	 * @throws InvocationTargetException
	 */
	public void transferirParaForm(OdontosisForm form, OdontosisBusinessObject... businessObjects) 
			throws IllegalAccessException, InvocationTargetException {
		for (OdontosisBusinessObject odontosisBusinessObject : businessObjects) {
			BeanUtils.copyProperties(form, odontosisBusinessObject);
		}
	}
}
